<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta charset="utf-8">
<title>原材料</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="../../res/css/layui.css" media="all">
<link rel="stylesheet" href="../../res/css/cst/snproduction.css"
	media="all">
<script type="text/javascript" src="../../res/js/jquery-1.11.2.min.js"></script>
</head>
<body>

	<div class="demoTable" style="margin-left: 20px; margin-top: 10px;">
	<from class="layui-form" id="selectFrom">
		材料名称:
		<div class="layui-inline">
			<input class="layui-input" style="height: 32px;" id="maName" maxlength="7" placeholder="请输入材料名称:"
				autocomplete="off">
		</div>
		开始时间：
		<div class="layui-inline">
			<input class="layui-input" style="height: 32px;width:130px;"  id="date"
				placeholder="yyyy-MM-dd" autocomplete="off">
		</div>
		-截止时间:
		<div class="layui-inline">
			<input class="layui-input"  id="time" style="height: 32px;width:130px;" 
				placeholder="yyyy-MM-dd" autocomplete="off">
		</div>

		材料类型:
		
		<div class="layui-inline">
			<select lay-filter="aihao" id="typeSelect" style="width: 100px;">
				
			</select>
		</div>
		</from>

		<button class="layui-btn layui-btn-sm" data-type="reload"
			id="selectButton">搜索</button>
		<button class="layui-btn layui-btn-warm layui-btn-sm" id="insert">增加</button>

	</div>

	<table class="layui-table"
		lay-data="{ url:'../../materials/findAll.action', page:true, id:'idTest'}"
		lay-filter="demo">
		<thead>
			<tr>
				<th lay-data="{type:'checkbox', fixed: 'left'}"></th>
				<th lay-data="{field:'maId',align:'center',width:'220'}">原材料编号</th>
				<th lay-data="{field:'typeName',sort: true, align:'center',width:'200'}">材料类型</th>
				<th lay-data="{field:'maName', align:'center',width:'200'}">材料名称</th>
				<th lay-data="{field:'maMoney', align:'center',width:'90'}">材料价格</th>
				<th lay-data="{field:'maUnit', align:'center',width:'90'}">材料单位</th>
				<th lay-data="{field:'firmName', align:'center',width:'150'}">生产厂商</th>
				<th lay-data="{field:'optime', align:'center',width:'160'}">操作时间</th>
				<th lay-data="{fixed: 'right',fixed: 'right', align:'center', toolbar: '#barDemo',width:'120'}">操作</th>
			</tr>
		</thead>
	</table>


	<script type="text/javascript" id="imgTpl">
	{{# if(d.proState == 0) { }}
		<div>等待提交审核</div>
	{{# }else if(d.proState == 1) { }}
		<div>等待审核</div>
 	{{# }else if(d.proState == 2) { }}
     <div>等待生产</div>
 	 {{# } else if(d.proState == 3){ }}
    <div>生产中</div>
	 {{# } else if(d.proState == 4){ }}
		<div>生产完成</div>
	{{# }else if(d.proState == 5){ }}
    	<div>等待质检</div>
	 {{# }else if(d.proState == 6){ }}
 		<div>质检完成</div>
	 {{# }}}
</script>

	<script type="text/html" id="barDemo">
     <button class="layui-btn layui-btn-xs" lay-event="edit">编辑</button>
	 <button class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</button>
</script>

	<!-- 增加或修改的弹框 -->
	<div id="addOrUpdate" style="display: none;">
		<form id="myform" onsubmit="return ss()" action="../../materials/addOrUpdate.action" class="layui-form" method="post"
			style="margin-top: 10px;">
			<input type="hidden" name="maId" id="maId" />
			<div class="aru">
				<label class="layui-form-label">材料名称:</label>
				<div class="layui-input-block">
					<input name="maName" id="maNameInput"  class="layui-input" onblur="findMaName();" placeholder="请输入材料名称"
						type="text">
					<input type="hidden" class='clyz' id="maNameInputyz">
				</div>
			</div>

			<div class="aru">
				<label class="layui-form-label">材料价格:</label>
				<div class="layui-input-block">
					<input name="maMoney" id="maMoney" onblur="findMaMoney();"  class="layui-input" type="text" placeholder="请输入材料价格">
					<input type="hidden" class='clyz' id="maMoneyInputyz">
				</div>
			</div>
			
			<div class="aru">
				<label class="layui-form-label">材料单位:</label>
				<div class="layui-input-block">
					<input name="maUnit" id="maUnit"  class="layui-input" onblur="findMaUnit();" type="text" placeholder="请输入材料单位">
					<input type="hidden" class='clyz' id="maUnitInputyz">
				</div>
			</div>
			
			<div class="aru" class="layui-form-item">
				<label class="layui-form-label">生产厂商:</label>
				<div class="layui-input-block">
					<select name="firmId" lay-filter="aihao" onblur="findFirmId();" id="firmId">
					</select>
				</div>
			</div>
			
			<div class="aru" class="layui-form-item">
				<label class="layui-form-label">材料类型:</label>
				<div class="layui-input-block">
					<select name="typeId" lay-filter="aihao" id="typeId">
					</select>
				</div>
			</div>
			
			<div class="aru">
				<div class="layui-input-block">
					<input type="button" class="layui-btn" id="sub" value="确认提交" /> <a
						href="javascript:exit();" class="layui-btn layui-btn-danger">关闭</a>
				</div>
			</div>
		</form>
	</div>
	<script src="../../res/layui.all.js" charset="utf-8"></script>
	<script type="text/javascript" src="../../res/js/cst/snmaterials.js"></script>
</body>
</html>